package com.huzz.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.huzz.model.SysLogModel;
import com.huzz.service.ISysLogService;
import com.huzz.vo.SysLogVO;
import com.huzz.util.body.JsonResult;
import com.huzz.util.body.ResultTool;
import com.huzz.util.log.LogStarter;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@LogStarter("系统日志模块")
@RestController
@RequestMapping("/api/SysLog")
@Api(value = "系统日志模块 API", tags = {"系统日志模块 API"})
public class SysLogController {

    @Autowired
    private ISysLogService logService;

    @ApiOperation(value = "查询日志分页列表")
    @GetMapping("/findMenuListPage")
    public JsonResult<IPage<SysLogVO>> findMenuListPage(@RequestParam(defaultValue = "1") Integer pageNum,
                                                        @RequestParam(defaultValue = "10") Integer pageSize,
                                                        SysLogModel model) {
        return ResultTool.success(logService.findSysLogListPage(pageNum, pageSize, model));
    }
}
